//package com.qiantu.phone.ui.activity;
//
//import android.content.Intent;
//import android.text.TextUtils;
//import android.util.Log;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.TextView;
//
//import androidx.annotation.NonNull;
//import androidx.annotation.Nullable;
//import androidx.lifecycle.LifecycleOwner;
//import androidx.recyclerview.widget.LinearLayoutManager;
//import androidx.recyclerview.widget.RecyclerView;
//
//import com.hjq.base.BaseDialog;
//import com.hjq.http.listener.HttpCallback;
//import com.hjq.widget.layout.SettingBar;
//import com.hjq.widget.swipelayout.SimpleSwipeListener;
//import com.hjq.widget.swipelayout.SwipeLayout;
//import com.hjq.widget.swipelayout.adapters.RecyclerSwipeAdapter;
//import com.hjq.widget.view.SwitchButton;
//import com.qiantu.api.db.LLDeviceDBManager;
//import com.qiantu.api.db.LLSceneDBManager;
//import com.qiantu.api.entity.CreateSceneResult;
//import com.qiantu.api.entity.DeviceBean;
//import com.qiantu.api.entity.RoomBean;
//import com.qiantu.api.entity.SceneBean;
//import com.qiantu.api.entity.SceneDetailBean;
//import com.qiantu.api.http.LLHttpManager;
//import com.qiantu.api.http.model.HttpData;
//import com.qiantu.phone.R;
//import com.qiantu.phone.app.AppActivity;
//import com.qiantu.phone.app.AppApplication;
//import com.qiantu.phone.event.RefreshSceneEvent;
//import com.qiantu.phone.glide.GlideApp;
//import com.qiantu.phone.ui.dialog.BottomDelayTimeDialog;
//import com.qiantu.phone.ui.dialog.BottomDeviceDialog;
//import com.qiantu.phone.ui.dialog.BottomEditDialog;
//import com.qiantu.phone.ui.dialog.ConfirmCancelHintDialog;
//import com.qiantu.phone.ui.dialog.ConfirmHintDialog;
//import com.qiantu.phone.ui.uiutil.LLDeviceUtil;
//import com.qiantu.phone.ui.uiutil.LLSceneLinkageUtil;
//import com.qiantu.phone.utils.TempDataHolder;
//import com.lxj.xpopup.XPopup;
//
//import org.greenrobot.eventbus.EventBus;
//import org.jetbrains.annotations.NotNull;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//
//
///**
// * Deprecated
// */
//public class EditSceneActivity extends AppActivity {
//    private SettingBar setName;
//    private SettingBar selectIcon;
//    private SettingBar selectRoom;
//    private SwitchButton frequentlySwitch;
//    private View btnCondition;
//    private ImageView iconSwitchBindStatus;
//    private ImageView addTask;
//    private String selectIconUrl;
//    private String selectRoomSerialNo;
//    private ImageView sceneIcon;
//    private SceneDetailBean sceneDetailBean;
//    private List<SceneDetailBean.SceneTaskBean> sceneTasks;
//    private RecyclerView vActionList;
//    private View vTip;
//    private View vDeleteScene;
//    private boolean isCreate;
//    private boolean isFirst = true;
//    private BottomDelayTimeDialog mBottomDelayTimeDialog;
//    private int deletePosition;
//
//    @Override
//    protected int getLayoutId() {
//        return R.layout.activity_edit_scene;
//    }
//
//    @Override
//    protected void initView() {
//        setName = findViewById(R.id.set_name);
//        selectIcon = findViewById(R.id.select_icon);
//        selectRoom = findViewById(R.id.select_room);
//        frequentlySwitch = findViewById(R.id.frequently_switch);
//        btnCondition = findViewById(R.id.btn_condition);
//        iconSwitchBindStatus = findViewById(R.id.icon_switch_bind_status);
//        addTask = findViewById(R.id.add_task);
//        sceneIcon = findViewById(R.id.scene_icon);
//        vActionList = findViewById(R.id.action_list);
//        vTip = findViewById(R.id.tip);
//        vDeleteScene = findViewById(R.id.delete_scene);
//        setOnClickListener(iconSwitchBindStatus, setName, selectIcon, selectRoom, frequentlySwitch, btnCondition, addTask, sceneIcon, vTip, vDeleteScene);
//    }
//
//    @Override
//    protected void initData() {
//        sceneDetailBean = TempDataHolder.getEditSceneDetailBean();
//        Log.i("luzxluzx", "initData sceneDetailBean:" + sceneDetailBean);
//        if (sceneDetailBean == null){
//            SceneDetailBean addScene = new SceneDetailBean();
//            addScene.setHouseSerialNo(AppApplication.getInstance().getCurHouseInfo().getHouseSerialNo());
//            addScene.setFavourite(true);
//            addScene.setSceneType(1);
//            addScene.setSceneTasks(new ArrayList<>());
//            TempDataHolder.setEditSceneDetailBean(addScene);
//            sceneDetailBean = addScene;
//        }
//        if (sceneDetailBean.getSceneTasks() == null){
//            sceneDetailBean.setSceneTasks(new ArrayList<>());
//        }
//        sceneTasks = sceneDetailBean.getSceneTasks();
//        sceneTaskAdapter = new SceneTaskAdapter();
//        vActionList.setLayoutManager(new LinearLayoutManager(getContext()));
//        vActionList.setAdapter(sceneTaskAdapter);
//        if (TextUtils.isEmpty(sceneDetailBean.getSceneSerialNo())){
//            setTitle(getString(R.string.create_scene));
//            isCreate = true;
//            vDeleteScene.setVisibility(View.GONE);
//        }else {
//            setTitle(getString(R.string.edit_scene));
//            isCreate = false;
//            vDeleteScene.setVisibility(View.VISIBLE);
//        }
//    }
//
//    @Override
//    protected void onNewIntent(Intent intent) {
//        super.onNewIntent(intent);
//    }
//
//    @Override
//    protected void onResume() {
//        super.onResume();
//        if (isFirst){
//            isFirst = false;
//            getTitleBar().getRightView().setSelected(false);
//        }else {
//            sceneDetailBean = TempDataHolder.getEditSceneDetailBean();
//            Log.i("luzxluzx", "onResume sceneDetailBean:" + sceneDetailBean);
//            if(sceneDetailBean == null){
//                return;
//            }
//            sceneTasks = sceneDetailBean.getSceneTasks();
//            sceneTaskAdapter.notifyDataSetChanged();
//            if(sceneDetailBean.getSwitchBindList() != null && sceneDetailBean.getSwitchBindList().size() > 0){
//                iconSwitchBindStatus.setImageDrawable(AppApplication.getInstance().getThemeDrawable(R.attr.icon_intelligent_switch_success));
//            }else{
//                iconSwitchBindStatus.setImageDrawable(AppApplication.getInstance().getThemeDrawable(R.attr.icon_intelligent_switch_add));
//            }
//            checkRightClick();
//        }
//        setName.setRightText(sceneDetailBean.getName());
//        selectIconUrl = sceneDetailBean.getImage();
//        setIcon();
//        if(RoomBean.ROOM_COMMON_SERIALNO.equals(sceneDetailBean.getRoomSerialNo()) || sceneDetailBean.getLinkType() == 2){
//            selectRoom.setRightText(R.string.common);
//        }else{
//            selectRoom.setRightText(sceneDetailBean.getRoomName());
//        }
//        frequentlySwitch.setChecked(sceneDetailBean.getFavourite());
//        if (sceneTasks.size()>0){
//            vTip.setVisibility(View.GONE);
//        }else {
//            vTip.setVisibility(View.VISIBLE);
//        }
//    }
//
//    @Override
//    public void onLeftClick(View view) {
//        onBackPressed();
//    }
//
//    @Override
//    public void onBackPressed() {
//        String tip = isCreate? getString(R.string.create_back_hint) : getString(R.string.edit_back_hint);
//        if (!isCreate){//修改场景
//            if (getTitleBar().getRightView().isSelected()){//已经有数据修改
//                new ConfirmHintDialog.Builder(this)
//                        .setLeftBtnText(getString(R.string.cancel))
//                        .setRightBtnText(getString(R.string.back))
//                        .setContent(tip)
//                        .setLeftBtnStrongHint(true)
//                        .setListener(new ConfirmHintDialog.OnListener() {
//                            @Override
//                            public void onLeftClick(BaseDialog dialog) {
//                                dialog.dismiss();
//                            }
//
//                            @Override
//                            public void onConfirm(BaseDialog dialog) {
//                                dialog.dismiss();
//                                finish();
//                            }
//                        })
//                        .show();
//            }else {
//                finish();
//            }
//        }else {
//            //已经有数据填写
//            if (sceneDetailBean == null || !TextUtils.isEmpty(sceneDetailBean.getName())
//                    || sceneDetailBean.hasSceneTasks() || !TextUtils.isEmpty(sceneDetailBean.getImage())
//                    || !TextUtils.isEmpty(sceneDetailBean.getRoomSerialNo())){
//                new ConfirmHintDialog.Builder(this)
//                        .setLeftBtnText(getString(R.string.cancel))
//                        .setRightBtnText(getString(R.string.back))
//                        .setContent(tip)
//                        .setLeftBtnStrongHint(true)
//                        .setListener(new ConfirmHintDialog.OnListener() {
//                            @Override
//                            public void onLeftClick(BaseDialog dialog) {
//                                dialog.dismiss();
//                            }
//
//                            @Override
//                            public void onConfirm(BaseDialog dialog) {
//                                dialog.dismiss();
//                                finish();
//                            }
//                        })
//                        .show();
//            }else {
//                finish();
//            }
//        }
//    }
//
//    @Override
//    public void finish() {
//        TempDataHolder.clearEditSceneDetailBean();
//        super.finish();
//    }
//
//    @Override
//    public void onRightClick(View view) {
//        if (isCreate){
//            LLHttpManager.sceneCreate(this, sceneDetailBean, new HttpCallback<HttpData<CreateSceneResult>>(this){
//                @Override
//                public void onSucceed(HttpData<CreateSceneResult> result) {
//                    super.onSucceed(result);
//                    SceneBean scene = result.getData().getCreateSceneDto();
//                    LLSceneDBManager.getInstance(getContext()).put(scene);
//                    TempDataHolder.clearEditSceneDetailBean();
//                    startActivity(HomeActivity.class);
//                    EventBus.getDefault().post(new RefreshSceneEvent());
//                }
//            });
//        }else {
//            LLHttpManager.sceneSave(this, sceneDetailBean, new HttpCallback<HttpData<CreateSceneResult>>(this){
//                @Override
//                public void onSucceed(HttpData<CreateSceneResult> result) {
//                    super.onSucceed(result);
//                    SceneBean scene = result.getData().getCreateSceneDto();
//                    LLSceneDBManager.getInstance(getContext()).put(scene);
//                    TempDataHolder.clearEditSceneDetailBean();
//                    EventBus.getDefault().post(new RefreshSceneEvent());
//                    startActivity(HomeActivity.class);
//                }
//            });
//        }
//
//    }
//
//    private void checkRightClick(){
//        getTitleBar().getRightView().setSelected(isDataComplete());
//    }
//
//    private boolean isDataComplete(){
//        if (sceneDetailBean == null) return false;
//        if (TextUtils.isEmpty(sceneDetailBean.getName())) return false;
//        if (sceneDetailBean.getSceneTasks()==null || sceneDetailBean.getSceneTasks().isEmpty()) return false;
//        if (TextUtils.isEmpty(sceneDetailBean.getImage())) return false;
//        if (TextUtils.isEmpty(sceneDetailBean.getRoomSerialNo())) return false;
//        return true;
//    }
//
//    @Override
//    public void onClick(View view) {
//        if (view == setName) {
//            showBottomEditDialog(setName.getRightText().toString().trim());
//        } else if (view == selectIcon || view == sceneIcon) {
//            Intent intent = new Intent(this, SceneIconSelectActivity.class);
//            intent.putExtra("selectIcon", sceneDetailBean.getImage());
//            startActivityForResult(intent, new OnActivityCallback() {
//                @Override
//                public void onActivityResult(int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
//                    if (resultCode == RESULT_OK) {
//                        selectIconUrl = data.getStringExtra("DATA");
//                        sceneDetailBean.setImage(selectIconUrl);
//                        setIcon();
//                        checkRightClick();
//                    }
//                }
//            });
//        } else if (view == selectRoom) {
//            Intent intent = new Intent(getContext(), SelectFloorRoomActivity.class);
//            intent.putExtra("roomSerialNo", sceneDetailBean.getRoomSerialNo());
//            intent.putExtra("linkType", sceneDetailBean.getLinkType().intValue());
//            startActivityForResult(intent, new OnActivityCallback() {
//                @Override
//                public void onActivityResult(int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
//                    if (resultCode == RESULT_OK) {
//                        selectRoomSerialNo = data.getStringExtra("serialNo");
//                        selectRoom.setRightText(data.getStringExtra("roomName"));
//                        if (RoomBean.ROOM_COMMON_SERIALNO.equals(selectRoomSerialNo)){
//                            sceneDetailBean.setLinkType(2);
//                        }else {
//                            sceneDetailBean.setLinkType(1);
//                        }
//                        sceneDetailBean.setRoomSerialNo(selectRoomSerialNo);
//                        sceneDetailBean.setRoomName(data.getStringExtra("roomName"));
//                        checkRightClick();
//                    }
//                }
//            });
//        } else if (view == frequentlySwitch) {
//            sceneDetailBean.setFavourite(frequentlySwitch.isChecked());
//            checkRightClick();
//        } else if (view == btnCondition) {
//        } else if (view == addTask || view == vTip) {
//            Intent intent = new Intent(this, AddTaskActivity.class);
//            intent.putExtra("type", AddTaskActivity.TYPE_SCENE);
//            startActivity(intent);
//        } else if (view == vDeleteScene){
//            showConfirmCancelHintDialog(getString(R.string.delete_scene_hint), getString(R.string.cancel), getString(R.string.delete_text), new ConfirmCancelHintDialog.OnListener() {
//                @Override
//                public void onLeftClick(BaseDialog dialog) {
//                    dialog.dismiss();
//                }
//
//                @Override
//                public void onRightClick(BaseDialog dialog) {
//                    dialog.dismiss();
//                    List<String> sceneSerialNoList = new ArrayList<>();
//                    sceneSerialNoList.add(sceneDetailBean.getSceneSerialNo());
//                    LLHttpManager.deleteScene((LifecycleOwner) getActivity(), sceneSerialNoList, new HttpCallback<HttpData<Void>>(null){
//                        @Override
//                        public void onSucceed(HttpData<Void> result) {
//                            super.onSucceed(result);
//                            LLSceneDBManager.getInstance(getContext()).remove(sceneDetailBean.getSceneSerialNo());
//                            EventBus.getDefault().post(new RefreshSceneEvent());
//                            TempDataHolder.clearEditSceneDetailBean();
//                            startActivity(HomeActivity.class);
//                        }
//                    });
//                }
//            });
//        } else if (view == iconSwitchBindStatus){
//            SwitchBindActivity.startForScene(this, sceneDetailBean.getSceneSerialNo(), sceneDetailBean.getHouseSerialNo());
//        }
//    }
//
//    private void setIcon() {
//        if (selectIconUrl == null || selectIconUrl.isEmpty()) {
//            sceneIcon.setVisibility(View.GONE);
//            selectIcon.setRightText("");
//        } else {
//            sceneIcon.setVisibility(View.VISIBLE);
//            GlideApp.with(getContext())
//                    .load(selectIconUrl)
//                    //.placeholder(R.drawable.avatar_placeholder_ic)
//                    //.error(R.drawable.avatar_placeholder_ic)
//                    .into(sceneIcon);
//            selectIcon.getRightView().setText("  ");
//        }
//    }
//
//    BottomEditDialog mBottomEditDialog;
//
//    private void showBottomEditDialog(String text) {
//        if (mBottomEditDialog == null) {
//            mBottomEditDialog = new BottomEditDialog(this);
//            mBottomEditDialog.setLabel(getString(R.string.scene_name));
//            mBottomEditDialog.setHint(getString(R.string.please_enter_scene_name));
//            mBottomEditDialog.setDialogClickListener(new BottomEditDialog.DialogClickListener() {
//                @Override
//                public void onConfirmClick() {
//                    setName.setRightText(mBottomEditDialog.getText());
//                    sceneDetailBean.setName(mBottomEditDialog.getText());
//                    checkRightClick();
//                }
//            });
//            new XPopup.Builder(this)
//                    .dismissOnBackPressed(true)
//                    .enableDrag(true)
//                    .asCustom(mBottomEditDialog);
//        }
//        mBottomEditDialog.setText(text);
//        mBottomEditDialog.show();
//    }
//
//    private SceneTaskAdapter sceneTaskAdapter;
//    private class SceneTaskAdapter extends RecyclerSwipeAdapter {
//        @Override
//        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//            View view = LayoutInflater.from(getContext()).inflate(R.layout.task_item, parent, false);
//            return new TaskItemViewHolder(view);
//        }
//
//        @Override
//        public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
//            TaskItemViewHolder vh = (TaskItemViewHolder) viewHolder;
//            SceneDetailBean.SceneTaskBean sceneTaskBean = sceneTasks.get(position);
//            if (sceneTaskBean.getSceneTaskType() == 1){
//                vh.value.setVisibility(View.GONE);
//                vh.valuesLy.setVisibility(View.VISIBLE);
//                String deviceSerialNo = sceneTaskBean.getSceneDeviceInstruct().getDeviceItemSerialNo();
//                DeviceBean device = LLDeviceDBManager.getInstance(getContext()).get(deviceSerialNo);
//                if(device == null){
//                    return;
//                }
//                GlideApp.with(getContext())
//                        .load(device.getOnImageUrl())
//                        .placeholder(vh.icon.getDrawable())
//                        .error(vh.icon.getDrawable())
//                        .into(vh.icon);
//                String deviceType = null;
//                String type = null;
//                if(device != null){
//                    type = device.getType();
//                    deviceType = device.getDeviceType();
//                }
//                Map<String, String> status = sceneTaskBean.getSceneDeviceInstruct().getDeviceItemStateData().getStatus();
//                List<String> values = LLDeviceUtil.getValueStr_max3(type, deviceType, status);
//                if (values.size()==0){
//                    vh.value1.setVisibility(View.GONE);
//                    vh.value2.setVisibility(View.GONE);
//                    vh.value3.setVisibility(View.GONE);
//                }else if (values.size()==1){
//                    vh.value1.setVisibility(View.VISIBLE);
//                    vh.value1.setText(values.get(0));
//                    vh.value2.setVisibility(View.GONE);
//                    vh.value3.setVisibility(View.GONE);
//                }else if (values.size()==2){
//                    vh.value1.setVisibility(View.VISIBLE);
//                    vh.value1.setText(values.get(0));
//                    vh.value2.setVisibility(View.VISIBLE);
//                    vh.value2.setText(values.get(1));
//                    vh.value3.setVisibility(View.GONE);
//                }else {
//                    vh.value1.setVisibility(View.VISIBLE);
//                    vh.value1.setText(values.get(0));
//                    vh.value2.setVisibility(View.VISIBLE);
//                    vh.value2.setText(values.get(1));
//                    vh.value3.setVisibility(View.VISIBLE);
//                    vh.value3.setText(values.get(2));
//                }
//            }else {
//                vh.icon.setImageResource(LLSceneLinkageUtil.getTaskIcon(sceneTaskBean.getSceneTaskType()));
//                vh.value.setVisibility(View.VISIBLE);
//                vh.valuesLy.setVisibility(View.GONE);
//                StringBuilder stringBuilder = new StringBuilder();
//                for(String s : LLSceneLinkageUtil.makeTaskBriefing(sceneTaskBean)){
//                    stringBuilder.append(s).append(",");
//                }
//                vh.value.setText(stringBuilder.substring(0, stringBuilder.length() - 1));
//            }
//            vh.name.setText(sceneTaskBean.getName());
//
//            vh.swipeLayout.addSwipeListener(new SimpleSwipeListener() {
//                @Override
//                public void onOpen(SwipeLayout layout) {
//                    viewHolder.setIsRecyclable(false);
//                }
//
//                @Override
//                public void onClose(SwipeLayout layout) {
//                    viewHolder.setIsRecyclable(true);
//                }
//            });
//            vh.ly.setTag(position);
//            vh.ly.setOnClickListener(listener);
//            vh.deleteImage.setTag(position);
//            vh.deleteImage.setOnClickListener(listener);
//            vh.addImage.setTag(position);
//            vh.addImage.setOnClickListener(listener);
//            mItemManger.bind(viewHolder.itemView, position);//实现只展现一条列表项的侧滑区域
//        }
//
//        @Override
//        public int getItemCount() {
//            return sceneTasks.size();
//        }
//
//        @Override
//        public long getItemId(int position) {
//            return super.getItemId(position);
//        }
//
//        @Override
//        public int getSwipeLayoutResourceId(int position) {
//            return R.id.swipe_layout;
//        }
//
//        private final View.OnClickListener listener = new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                int position = (int) v.getTag();
//                if (v.getId() == R.id.add_image){
//                    Intent intent = new Intent(EditSceneActivity.this, AddTaskActivity.class);
//                    intent.putExtra("position", position);
//                    intent.putExtra("type", AddTaskActivity.TYPE_SCENE);
//                    startActivity(intent);
//                    mItemManger.closeItem(position);
//                }else if (v.getId() == R.id.delete_image){
//                    deletePosition = position;
//                    showDeleteHintDialog();
//                }else if (v.getId() == R.id.ly){
//                    if (mItemManger.isOpen(position)){
//                        mItemManger.closeItem(position);
//                    }else {
//                        editTask(position);
//                    }
//                }
//            }
//        };
//    }
//
//    private BaseDialog mConfirmCancelHintDialog;
//    private ConfirmCancelHintDialog.Builder mConfirmCancelHintDialogBuilder;
//    private void showDeleteHintDialog() {
//        if (mConfirmCancelHintDialog == null) {
//            mConfirmCancelHintDialogBuilder = new ConfirmCancelHintDialog.Builder(getActivity());
//            mConfirmCancelHintDialog = mConfirmCancelHintDialogBuilder.create();
//        }
//        mConfirmCancelHintDialogBuilder.setListener(new ConfirmCancelHintDialog.OnListener() {
//            @Override
//            public void onLeftClick(BaseDialog dialog) {
//                mConfirmCancelHintDialogBuilder.dismiss();
//            }
//
//            @Override
//            public void onRightClick(BaseDialog dialog) {
//                mConfirmCancelHintDialogBuilder.dismiss();
//
//                sceneTasks.remove(deletePosition);
//                //notifyItemRemoved(position);
//                sceneTaskAdapter.notifyDataSetChanged();
//                sceneTaskAdapter.mItemManger.closeAllItems();
//                checkRightClick();
//                if (sceneTasks.size()>0){
//                    vTip.setVisibility(View.GONE);
//                }else {
//                    vTip.setVisibility(View.VISIBLE);
//                }
//            }
//        });
//        mConfirmCancelHintDialogBuilder.setContent(getString(R.string.delete_task_hint));
//        mConfirmCancelHintDialog.show();
//    }
//
//
//    private void editTask(int position) {
//        SceneDetailBean.SceneTaskBean sceneTaskBean = sceneTasks.get(position);
//        switch (sceneTaskBean.getSceneTaskType()){
//            case 1:{//设备指令
//                showDeviceDialog(sceneTaskBean, position);
//                break;
//            }
//            case 2:{//延时任务
//                showBottomTimeDialog(sceneTaskBean, position);
//                break;
//            }
//            case 3:{
//                Intent intent = new Intent(this, PushMessageSettingActivity.class);
//                intent.putExtra("serial_no", sceneTaskBean.getSerialNo());
//                intent.putExtra("type", AddTaskActivity.TYPE_SCENE);
//                startActivity(intent);
//                break;
//            }
//            case 4:{
//                Intent intent = new Intent(this, LinkageStartStopActivity.class);
//                intent.putExtra("serial_no", sceneTaskBean.getSerialNo());
//                intent.putExtra("type", AddTaskActivity.TYPE_SCENE);
//                startActivity(intent);
//                break;
//            }
//        }
//    }
//
//    private BottomDeviceDialog mDeviceDialog;
//    private void showDeviceDialog(SceneDetailBean.SceneTaskBean sceneTaskBean, int position) {
//        SceneDetailBean.SceneDeviceInstructBean instructBean = sceneTaskBean.getSceneDeviceInstruct();
//        DeviceBean deviceBean = LLDeviceDBManager.getInstance(getContext()).get(instructBean.getDeviceItemSerialNo());
//        mDeviceDialog = new BottomDeviceDialog(this){
//            @Override
//            public void onSave(Map<String, String> statusJson) {
//                instructBean.getDeviceItemStateData().setStatus(statusJson);
//                sceneTaskAdapter.notifyItemChanged(position);
//                checkRightClick();
//            }
//        };
//        new XPopup.Builder(this)
//                .dismissOnBackPressed(true)
//                .enableDrag(false)
//                .asCustom(mDeviceDialog);
//        mDeviceDialog.setDeviceBean(deviceBean, instructBean.getDeviceItemStateData().getStatus());
//        mDeviceDialog.show();
//    }
//
//    private void showBottomTimeDialog(SceneDetailBean.SceneTaskBean sceneTaskBean, int position){
//        if (mBottomDelayTimeDialog == null) {
//            mBottomDelayTimeDialog = new BottomDelayTimeDialog(this);
//            mBottomDelayTimeDialog.setDialogClickListener(new BottomDelayTimeDialog.DialogClickListener() {
//                @Override
//                public void onConfirmClick(String time, int longTime) {
//                    mBottomDelayTimeDialog.dismiss();
//                    sceneTaskBean.getSceneDelayedTask().setLongTime(longTime);
//                    sceneTaskAdapter.notifyItemChanged(position);
//                    checkRightClick();
//                }
//            });
//            new XPopup.Builder(this)
//                    .dismissOnBackPressed(true)
//                    .enableDrag(true)
//                    .asCustom(mBottomDelayTimeDialog);
//        }
//        mBottomDelayTimeDialog.setMillisecond(sceneTaskBean.getSceneDelayedTask().getLongTime());
//        mBottomDelayTimeDialog.show();
//    }
//
//    private class TaskItemViewHolder extends RecyclerView.ViewHolder {
//        public SwipeLayout swipeLayout;
//        public LinearLayout seeLayout;
//        public ImageView addImage;
//        public ImageView deleteImage;
//        public ImageView icon;
//        public TextView name;
//        public TextView value;
//        public TextView value1;
//        public TextView value2;
//        public TextView value3;
//        public LinearLayout valuesLy;
//        public View ly;
//        public TaskItemViewHolder(@NonNull @NotNull View itemView) {
//            super(itemView);
//            swipeLayout = itemView.findViewById(R.id.swipe_layout);
//            seeLayout = itemView.findViewById(R.id.see_layout);
//            addImage = itemView.findViewById(R.id.add_image);
//            deleteImage = itemView.findViewById(R.id.delete_image);
//            icon = itemView.findViewById(R.id.icon);
//            name = itemView.findViewById(R.id.name);
//            value = itemView.findViewById(R.id.value);
//            value1 = itemView.findViewById(R.id.value1);
//            value2 = itemView.findViewById(R.id.value2);
//            value3 = itemView.findViewById(R.id.value3);
//            valuesLy = itemView.findViewById(R.id.status_ly);
//            ly = itemView.findViewById(R.id.ly);
//        }
//    }
//}